From 341d8605b6fbb41482db58d6e670c25da06732b8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Javier=20Jard=C3=B3n?= Date: Thu, 26 Nov 2009 05:48:52 +0100 Subject: [PATCH] [gdk] Remove deprecated GdkRGB stuff --- .../gdk-pixbuf/tmpl/gdk-pixbuf-unused.sgml | 8 ---- docs/reference/gdk/gdk-sections.txt | 4 -- docs/reference/gdk/tmpl/rgb.sgml | 39 ---------------- gdk/gdk.symbols | 6 --- gdk/gdkrgb.c | 45 ------------------- gdk/gdkrgb.h | 11 ----- 6 files changed, 113 deletions(-) diff --git a/docs/reference/gdk-pixbuf/tmpl/gdk-pixbuf-unused.sgml b/docs/reference/gdk-pixbuf/tmpl/gdk-pixbuf-unused.sgml index 128ca4a750..a9891e0bf8 100644 --- a/docs/reference/gdk-pixbuf/tmpl/gdk-pixbuf-unused.sgml +++ b/docs/reference/gdk-pixbuf/tmpl/gdk-pixbuf-unused.sgml @@ -215,14 +215,6 @@ GnomeCanvasPixbuf and use that to draw the image onto a drawable. - - - Since these functions use GdkRGB for rendering, you must - initialize GdkRGB before using any of them. You can do this by - calling gdk_rgb_init() near the beginning of your program. - - - diff --git a/docs/reference/gdk/gdk-sections.txt b/docs/reference/gdk/gdk-sections.txt index a4c99e6301..98d32ba639 100644 --- a/docs/reference/gdk/gdk-sections.txt +++ b/docs/reference/gdk/gdk-sections.txt @@ -305,7 +305,6 @@ gdk_image_get_type
GdkRGB rgb -gdk_rgb_init gdk_draw_rgb_image @@ -322,9 +321,6 @@ gdk_rgb_cmap_free GdkRgbCmap -gdk_rgb_gc_set_foreground -gdk_rgb_gc_set_background -gdk_rgb_xpixel_from_rgb gdk_rgb_find_color diff --git a/docs/reference/gdk/tmpl/rgb.sgml b/docs/reference/gdk/tmpl/rgb.sgml index 000f2ce027..857558d71e 100644 --- a/docs/reference/gdk/tmpl/rgb.sgml +++ b/docs/reference/gdk/tmpl/rgb.sgml @@ -125,14 +125,6 @@ colors. - - -This function no longer does anything at all. It's completely useless -(and harmless). - - - - Draws an RGB image in the drawable. This is the core GdkRGB @@ -328,37 +320,6 @@ colors. This is used only for gdk_draw_indexed_image(). @colors: The colors, represented as 0xRRGGBB integer values. @n_colors: The number of colors in the cmap. - - -Sets the foreground color in @gc to the specified color (or the -closest approximation, in the case of limited visuals). - - -@gc: The #GdkGC to modify. -@rgb: The color, represented as a 0xRRGGBB integer value. - - - - -Sets the background color in @gc to the specified color (or the -closest approximation, in the case of limited visuals). - - -@gc: The #GdkGC to modify. -@rgb: The color, represented as a 0xRRGGBB integer value. - - - - -Finds the X pixel closest in color to the @rgb color specified. This -value may be used to set the pixel field of -a #GdkColor struct. - - -@rgb: The color, represented as a 0xRRGGBB integer value. -@Returns: The X pixel value. - - diff --git a/gdk/gdk.symbols b/gdk/gdk.symbols index fe3e0a671b..b95fe78b31 100644 --- a/gdk/gdk.symbols +++ b/gdk/gdk.symbols @@ -984,12 +984,6 @@ gdk_rgb_ditherable gdk_rgb_find_color gdk_rgb_get_colormap gdk_rgb_get_visual -#ifndef GDK_DISABLE_DEPRECATED -gdk_rgb_init -gdk_rgb_xpixel_from_rgb G_GNUC_CONST -gdk_rgb_gc_set_background -gdk_rgb_gc_set_foreground -#endif gdk_rgb_set_install gdk_rgb_set_min_colors gdk_rgb_set_verbose diff --git a/gdk/gdkrgb.c b/gdk/gdkrgb.c index 7885c920ab..4c7c858b20 100644 --- a/gdk/gdkrgb.c +++ b/gdk/gdkrgb.c @@ -672,21 +672,6 @@ gdk_rgb_create_info (GdkVisual *visual, GdkColormap *colormap) return image_info; } -void -gdk_rgb_init (void) -{ - static const gint byte_order[1] = { 1 }; - - /* check endian sanity */ -#if G_BYTE_ORDER == G_BIG_ENDIAN - if (((char *)byte_order)[0] == 1) - g_error ("gdk_rgb_init: compiled for big endian, but this is a little endian machine.\n\n"); -#else - if (((char *)byte_order)[0] != 1) - g_error ("gdk_rgb_init: compiled for little endian, but this is a big endian machine.\n\n"); -#endif -} - static GdkRgbInfo * gdk_rgb_get_info_from_colormap (GdkColormap *cmap) { @@ -779,36 +764,6 @@ gdk_rgb_xpixel_from_rgb_internal (GdkColormap *colormap, return pixel; } -/* convert an rgb value into an X pixel code */ -gulong -gdk_rgb_xpixel_from_rgb (guint32 rgb) -{ - guint32 r = rgb & 0xff0000; - guint32 g = rgb & 0xff00; - guint32 b = rgb & 0xff; - - return gdk_rgb_xpixel_from_rgb_internal (gdk_screen_get_rgb_colormap (gdk_screen_get_default ()), - (r >> 8) + (r >> 16), g + (g >> 8), b + (b << 8)); -} - -void -gdk_rgb_gc_set_foreground (GdkGC *gc, guint32 rgb) -{ - GdkColor color; - - color.pixel = gdk_rgb_xpixel_from_rgb (rgb); - gdk_gc_set_foreground (gc, &color); -} - -void -gdk_rgb_gc_set_background (GdkGC *gc, guint32 rgb) -{ - GdkColor color; - - color.pixel = gdk_rgb_xpixel_from_rgb (rgb); - gdk_gc_set_background (gc, &color); -} - /** * gdk_rgb_find_color: * @colormap: a #GdkColormap diff --git a/gdk/gdkrgb.h b/gdk/gdkrgb.h index 3136e9afeb..919ac35fe6 100644 --- a/gdk/gdkrgb.h +++ b/gdk/gdkrgb.h @@ -45,17 +45,6 @@ struct _GdkRgbCmap { GSList *info_list; }; -#ifndef GDK_DISABLE_DEPRECATED -void gdk_rgb_init (void); - -gulong gdk_rgb_xpixel_from_rgb (guint32 rgb) G_GNUC_CONST; -void gdk_rgb_gc_set_foreground (GdkGC *gc, - guint32 rgb); -void gdk_rgb_gc_set_background (GdkGC *gc, - guint32 rgb); -#define gdk_rgb_get_cmap gdk_rgb_get_colormap -#endif /* GDK_DISABLE_DEPRECATED */ - void gdk_rgb_find_color (GdkColormap *colormap, GdkColor *color); -- 2.30.2